package com.ynet.middleground.contract.bean;

import java.util.List;

import javax.validation.constraints.NotBlank;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author liulx
 * @description 新增模板请求类
 * @date 2020-03-19 21:42
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "新增模板请求类", description = "添加新的模板")
public class AddTemplateReq extends EnterpriseBaseReqObj {

    private static final long serialVersionUID = -3220670320719131806L;

    @ApiModelProperty(value = "业态公司 id \n（仅综合管理平台使用）", notes = "业态公司 id \n（仅综合管理平台使用）", dataType = "Integer")
    private Integer formatId;

    /**
     * 模板名称
     */
    @ApiModelProperty(value = "模板名称", notes = "模板名称", dataType = "String", required = true)
    @NotBlank(message = "模板名称不能为空")
    private String name;

    /**
     * 模板类型 0：合同模板、1：平台协议模板、2：档案模板
     */
    @ApiModelProperty(value = "模板类型 0：合同模板、1：平台协议模板、2：档案模板", notes = "模板类型 0：合同模板、1：平台协议模板、2：档案模板", dataType = "String",
        allowableValues = "0, 1, 2", required = true)
    @NotBlank(message = "模板类型不能为空")
    private String type;

    /**
     * 产品类型
     */
    @ApiModelProperty(value = "产品类型（合约模板、档案模板必填）", notes = "产品类型", dataType = "String")
    private String productType;

    /**
     * 合约类型
     */
    @ApiModelProperty(value = "合约类型（合约模板必填）", notes = "合约类型", dataType = "Integer")
    private Integer contractTypeId;

    /**
     * 描述
     */
    @ApiModelProperty(value = "描述", notes = "描述", dataType = "String")
    private String description;

    /**
     * 模板文件 OSS 地址
     */
    @ApiModelProperty(value = "模板文件 OSS 短路径地址(包含 Bucket) \n  如：zhongtai/file.pdf",
        notes = "模板文件 OSS 短路径地址(包含 Bucket) \n  如：zhongtai/file.pdf", dataType = "String", required = true)
    @NotBlank(message = "模板文件 OSS 短路径地址不能为空")
    private String content;

    /**
     * 签章数量
     */
    @ApiModelProperty(value = "签章数量（合约模板必填）", notes = "签章数量", dataType = "Integer")
    private Integer signatureNumber;

    /**
     * 模板参数列表
     */
    @ApiModelProperty(value = "模板参数列表", notes = "模板参数列表", required = true,
        example = "[\n" + "  {\n" + "    \"paramName\": \"date\",\n" + "    \"type\": \"0\",\n"
            + "    \"description\": \"日期\",\n" + "    \"isRequired\": false\n" + "  },\n" + "  {\n"
            + "    \"paramName\": \"invoice_tables\",\n" + "    \"type\": \"2\",\n" + "    \"description\": \"收据表格\",\n"
            + "    \"isRequired\": false,\n" + "    \"tableParams\": [\n" + "      {\n"
            + "        \"description\": \"序号\",\n" + "        \"name\": \"num\"\n" + "      },\n" + "      {\n"
            + "        \"description\": \"名称\",\n" + "        \"name\": \"name\"\n" + "      },\n" + "      {\n"
            + "        \"description\": \"价格\",\n" + "        \"name\": \"money\"\n" + "      }\n" + "    ]\n" + "  }\n"
            + "]")
    private List<TemplateParamReq> params;

}
